package com.xcx.common.exceptions;

import com.xcx.common.enums.RespCodeEnum;

import lombok.Getter;

/**
 * 公共业务异常
 * @author yangjun  
 * @date 2018年7月12日 下午10:34:08
 */
@Getter
public class CommonException extends RuntimeException {

	private static final long serialVersionUID = 807751174148354521L;
	
	protected RespCodeEnum respCode;
	
	private String respMsg;
	
	public CommonException() {
		super();
	}

	public CommonException(String message, Throwable cause) {
		super(message, cause);
	}
	
	public CommonException(RespCodeEnum respCode) {
		this.respCode = respCode;
		this.respMsg = respCode.getMessage();
	}
	public CommonException(String respMsg) {
		this.respMsg = respMsg;
	}

	public CommonException(RespCodeEnum respCode , String respMsg) {
		this.respCode = respCode;
		this.respMsg = respMsg;
	}
}
